package pub.cleangao.mybatis.quick;

import pub.cleangao.mybatis.execution.CreateExecution;

import java.util.Arrays;
import java.util.List;


public class Insert implements Quick<Integer> {

    private final CreateExecution execution;

    private Insert(CreateExecution execution) {
        this.execution = execution;
    }

    public static Insert into(String table) {
        return new Insert(CreateExecution.startInsert(table));
    }


    @Override
    public Integer done() throws Exception {
        return (Integer) execution.done();
    }

    public Insert columns(List<String> columns) {
        execution.setColumnList(columns);
        return this;
    }

    public Insert columns(String... columns) {
        execution.setColumnList(Arrays.asList(columns));
        return this;
    }


    public Insert values(List<Object> values) {
        execution.setValues(values);
        return this;
    }

    public Insert values(String... values) {
        execution.setValues(Arrays.asList(values));
        return this;
    }




}
